Integrand size = 20, antiderivative size = 130 \[ \int (d+i c d x) (a+b \arctan (c x))^2 \, dx=-i a b d x-i b^2 d x \arctan (c x)-\frac {i d (1+i c x)^2 (a+b \arctan (c x))^2}{2 c}+\frac {2 b d (a+b \arctan (c x)) \log \left (\frac {2}{1-i c x}\right )}{c}+\frac {i b^2 d \log \left (1+c^2 x^2\right )}{2 c}-\frac {i b^2 d \operatorname {PolyLog}\left (2,1-\frac {2}{1-i c x}\right )}{c} \]
[Out]
Time = 0.09 (sec) , antiderivative size = 130, normalized size of antiderivative = 1.00, number of steps used = 9, number of rules used = 7, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.350, Rules used = {4974, 4930, 266, 1600, 4964, 2449, 2352} \[ \int (d+i c d x) (a+b \arctan (c x))^2 \, dx=-\frac {i d (1+i c x)^2 (a+b \arctan (c x))^2}{2 c}+\frac {2 b d \log \left (\frac {2}{1-i c x}\right ) (a+b \arctan (c x))}{c}-i a b d x-i b^2 d x \arctan (c x)+\frac {i b^2 d \log \left (c^2 x^2+1\right )}{2 c}-\frac {i b^2 d \operatorname {PolyLog}\left (2,1-\frac {2}{1-i c x}\right )}{c} \]
[In]
[Out]
Rule 266
Rule 1600
Rule 2352
Rule 2449
Rule 4930
Rule 4964
Rule 4974
Rubi steps \begin{align*} \text {integral}& = -\frac {i d (1+i c x)^2 (a+b \arctan (c x))^2}{2 c}+\frac {(i b) \int \left (-d^2 (a+b \arctan (c x))-\frac {2 i \left (i d^2-c d^2 x\right ) (a+b \arctan (c x))}{1+c^2 x^2}\right ) \, dx}{d} \\ & = -\frac {i d (1+i c x)^2 (a+b \arctan (c x))^2}{2 c}+\frac {(2 b) \int \frac {\left (i d^2-c d^2 x\right ) (a+b \arctan (c x))}{1+c^2 x^2} \, dx}{d}-(i b d) \int (a+b \arctan (c x)) \, dx \\ & = -i a b d x-\frac {i d (1+i c x)^2 (a+b \arctan (c x))^2}{2 c}+\frac {(2 b) \int \frac {a+b \arctan (c x)}{-\frac {i}{d^2}-\frac {c x}{d^2}} \, dx}{d}-\left (i b^2 d\right ) \int \arctan (c x) \, dx \\ & = -i a b d x-i b^2 d x \arctan (c x)-\frac {i d (1+i c x)^2 (a+b \arctan (c x))^2}{2 c}+\frac {2 b d (a+b \arctan (c x)) \log \left (\frac {2}{1-i c x}\right )}{c}-\left (2 b^2 d\right ) \int \frac {\log \left (\frac {2}{1-i c x}\right )}{1+c^2 x^2} \, dx+\left (i b^2 c d\right ) \int \frac {x}{1+c^2 x^2} \, dx \\ & = -i a b d x-i b^2 d x \arctan (c x)-\frac {i d (1+i c x)^2 (a+b \arctan (c x))^2}{2 c}+\frac {2 b d (a+b \arctan (c x)) \log \left (\frac {2}{1-i c x}\right )}{c}+\frac {i b^2 d \log \left (1+c^2 x^2\right )}{2 c}-\frac {\left (2 i b^2 d\right ) \text {Subst}\left (\int \frac {\log (2 x)}{1-2 x} \, dx,x,\frac {1}{1-i c x}\right )}{c} \\ & = -i a b d x-i b^2 d x \arctan (c x)-\frac {i d (1+i c x)^2 (a+b \arctan (c x))^2}{2 c}+\frac {2 b d (a+b \arctan (c x)) \log \left (\frac {2}{1-i c x}\right )}{c}+\frac {i b^2 d \log \left (1+c^2 x^2\right )}{2 c}-\frac {i b^2 d \operatorname {PolyLog}\left (2,1-\frac {2}{1-i c x}\right )}{c} \\ \end{align*}
Time = 0.31 (sec) , antiderivative size = 151, normalized size of antiderivative = 1.16 \[ \int (d+i c d x) (a+b \arctan (c x))^2 \, dx=\frac {i d \left (-2 i a^2 c x-2 a b c x+a^2 c^2 x^2+b^2 (-i+c x)^2 \arctan (c x)^2+2 b \arctan (c x) \left (a-2 i a c x-b c x+a c^2 x^2-2 i b \log \left (1+e^{2 i \arctan (c x)}\right )\right )+2 i a b \log \left (1+c^2 x^2\right )+b^2 \log \left (1+c^2 x^2\right )-2 b^2 \operatorname {PolyLog}\left (2,-e^{2 i \arctan (c x)}\right )\right )}{2 c} \]
[In]
[Out]
Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 277 vs. \(2 (118 ) = 236\).
Time = 1.30 (sec) , antiderivative size = 278, normalized size of antiderivative = 2.14
method | result | size |
parts | \(-i a^{2} d \left (-\frac {1}{2} c \,x^{2}+i x \right )+\frac {d \,b^{2} \left (\frac {i \arctan \left (c x \right )^{2} c^{2} x^{2}}{2}+\arctan \left (c x \right )^{2} c x +i \left (i \arctan \left (c x \right ) \ln \left (c^{2} x^{2}+1\right )+\frac {\arctan \left (c x \right )^{2}}{2}-c x \arctan \left (c x \right )-\frac {\ln \left (c x -i\right ) \ln \left (c^{2} x^{2}+1\right )}{2}+\frac {\operatorname {dilog}\left (-\frac {i \left (c x +i\right )}{2}\right )}{2}+\frac {\ln \left (c x -i\right ) \ln \left (-\frac {i \left (c x +i\right )}{2}\right )}{2}+\frac {\ln \left (c x -i\right )^{2}}{4}+\frac {\ln \left (c x +i\right ) \ln \left (c^{2} x^{2}+1\right )}{2}-\frac {\operatorname {dilog}\left (\frac {i \left (c x -i\right )}{2}\right )}{2}-\frac {\ln \left (c x +i\right ) \ln \left (\frac {i \left (c x -i\right )}{2}\right )}{2}-\frac {\ln \left (c x +i\right )^{2}}{4}+\frac {\ln \left (c^{2} x^{2}+1\right )}{2}\right )\right )}{c}+\frac {2 a b d \left (\frac {i \arctan \left (c x \right ) c^{2} x^{2}}{2}+c x \arctan \left (c x \right )+\frac {i \left (-c x +i \ln \left (c^{2} x^{2}+1\right )+\arctan \left (c x \right )\right )}{2}\right )}{c}\) | \(278\) |
derivativedivides | \(\frac {-i a^{2} d \left (-\frac {1}{2} c^{2} x^{2}+i c x \right )+d \,b^{2} \left (\frac {i \arctan \left (c x \right )^{2} c^{2} x^{2}}{2}+\arctan \left (c x \right )^{2} c x +i \left (i \arctan \left (c x \right ) \ln \left (c^{2} x^{2}+1\right )+\frac {\arctan \left (c x \right )^{2}}{2}-c x \arctan \left (c x \right )-\frac {\ln \left (c x -i\right ) \ln \left (c^{2} x^{2}+1\right )}{2}+\frac {\operatorname {dilog}\left (-\frac {i \left (c x +i\right )}{2}\right )}{2}+\frac {\ln \left (c x -i\right ) \ln \left (-\frac {i \left (c x +i\right )}{2}\right )}{2}+\frac {\ln \left (c x -i\right )^{2}}{4}+\frac {\ln \left (c x +i\right ) \ln \left (c^{2} x^{2}+1\right )}{2}-\frac {\operatorname {dilog}\left (\frac {i \left (c x -i\right )}{2}\right )}{2}-\frac {\ln \left (c x +i\right ) \ln \left (\frac {i \left (c x -i\right )}{2}\right )}{2}-\frac {\ln \left (c x +i\right )^{2}}{4}+\frac {\ln \left (c^{2} x^{2}+1\right )}{2}\right )\right )+2 a b d \left (\frac {i \arctan \left (c x \right ) c^{2} x^{2}}{2}+c x \arctan \left (c x \right )+\frac {i \left (-c x +i \ln \left (c^{2} x^{2}+1\right )+\arctan \left (c x \right )\right )}{2}\right )}{c}\) | \(279\) |
default | \(\frac {-i a^{2} d \left (-\frac {1}{2} c^{2} x^{2}+i c x \right )+d \,b^{2} \left (\frac {i \arctan \left (c x \right )^{2} c^{2} x^{2}}{2}+\arctan \left (c x \right )^{2} c x +i \left (i \arctan \left (c x \right ) \ln \left (c^{2} x^{2}+1\right )+\frac {\arctan \left (c x \right )^{2}}{2}-c x \arctan \left (c x \right )-\frac {\ln \left (c x -i\right ) \ln \left (c^{2} x^{2}+1\right )}{2}+\frac {\operatorname {dilog}\left (-\frac {i \left (c x +i\right )}{2}\right )}{2}+\frac {\ln \left (c x -i\right ) \ln \left (-\frac {i \left (c x +i\right )}{2}\right )}{2}+\frac {\ln \left (c x -i\right )^{2}}{4}+\frac {\ln \left (c x +i\right ) \ln \left (c^{2} x^{2}+1\right )}{2}-\frac {\operatorname {dilog}\left (\frac {i \left (c x -i\right )}{2}\right )}{2}-\frac {\ln \left (c x +i\right ) \ln \left (\frac {i \left (c x -i\right )}{2}\right )}{2}-\frac {\ln \left (c x +i\right )^{2}}{4}+\frac {\ln \left (c^{2} x^{2}+1\right )}{2}\right )\right )+2 a b d \left (\frac {i \arctan \left (c x \right ) c^{2} x^{2}}{2}+c x \arctan \left (c x \right )+\frac {i \left (-c x +i \ln \left (c^{2} x^{2}+1\right )+\arctan \left (c x \right )\right )}{2}\right )}{c}\) | \(279\) |
risch | \(a^{2} d x -\frac {a b d \ln \left (c^{2} x^{2}+1\right )}{4 c}-\frac {3 \ln \left (-i c x +1\right ) a b d}{2 c}+\frac {3 i a^{2} d}{2 c}+\frac {i b^{2} \operatorname {dilog}\left (\frac {1}{2}-\frac {i c x}{2}\right ) d}{c}+\frac {i a^{2} c d \,x^{2}}{2}-\frac {i a b d \arctan \left (c x \right )}{2 c}+i \ln \left (-i c x +1\right ) a b d x -\frac {3 i \ln \left (-i c x +1\right )^{2} b^{2} d}{8 c}-\frac {\ln \left (-i c x +1\right )^{2} b^{2} d x}{4}+\frac {d \,b^{2} \ln \left (-i c x +1\right ) x}{2}+\frac {a b d}{c}+\frac {i \ln \left (-i c x +1\right ) b^{2} d}{2 c}+\frac {i b^{2} d \ln \left (c^{2} x^{2}+1\right )}{4 c}-\frac {b^{2} d \arctan \left (c x \right )}{2 c}+\left (\frac {i d \,b^{2} \left (c \,x^{2}-2 i x \right ) \ln \left (-i c x +1\right )}{4}+\frac {b d \left (2 c^{2} x^{2} a -4 i x a c +3 i b \ln \left (-i c x +1\right )-2 x b c \right )}{4 c}\right ) \ln \left (i c x +1\right )-i a b d x -\frac {i b^{2} \ln \left (-i c x +1\right ) \ln \left (\frac {1}{2}+\frac {i c x}{2}\right ) d}{c}+\frac {i b^{2} \ln \left (\frac {1}{2}-\frac {i c x}{2}\right ) \ln \left (\frac {1}{2}+\frac {i c x}{2}\right ) d}{c}-\frac {d c a b \ln \left (-i c x +1\right ) x^{2}}{2}-\frac {i d \,b^{2} \left (c^{2} x^{2}-2 i c x -1\right ) \ln \left (i c x +1\right )^{2}}{8 c}-\frac {i d c \,b^{2} \ln \left (-i c x +1\right )^{2} x^{2}}{8}\) | \(425\) |
[In]
[Out]
\[ \int (d+i c d x) (a+b \arctan (c x))^2 \, dx=\int { {\left (i \, c d x + d\right )} {\left (b \arctan \left (c x\right ) + a\right )}^{2} \,d x } \]
[In]
[Out]
\[ \int (d+i c d x) (a+b \arctan (c x))^2 \, dx=\frac {i d \left (\int \left (- \frac {4 i a^{2}}{c^{2} x^{2} + 1}\right )\, dx + \int \left (- \frac {i b^{2} \log {\left (i c x + 1 \right )}}{c^{2} x^{2} + 1}\right )\, dx + \int \left (- \frac {4 a b \log {\left (i c x + 1 \right )}}{c^{2} x^{2} + 1}\right )\, dx + \int \frac {4 a^{2} c x}{c^{2} x^{2} + 1}\, dx + \int \frac {4 a^{2} c^{3} x^{3}}{c^{2} x^{2} + 1}\, dx + \int \frac {2 b^{2} c x}{c^{2} x^{2} + 1}\, dx + \int \left (- \frac {4 i a^{2} c^{2} x^{2}}{c^{2} x^{2} + 1}\right )\, dx + \int \frac {2 i b^{2} c^{2} x^{2}}{c^{2} x^{2} + 1}\, dx + \int \left (- \frac {6 a b c^{2} x^{2}}{c^{2} x^{2} + 1}\right )\, dx + \int \frac {5 b^{2} c x \log {\left (i c x + 1 \right )}}{c^{2} x^{2} + 1}\, dx + \int \frac {4 i a b c x}{c^{2} x^{2} + 1}\, dx + \int \left (- \frac {2 i a b c^{3} x^{3}}{c^{2} x^{2} + 1}\right )\, dx + \int \frac {2 i b^{2} c^{2} x^{2} \log {\left (i c x + 1 \right )}}{c^{2} x^{2} + 1}\, dx + \int \left (- \frac {4 a b c^{2} x^{2} \log {\left (i c x + 1 \right )}}{c^{2} x^{2} + 1}\right )\, dx + \int \left (- \frac {4 i a b c x \log {\left (i c x + 1 \right )}}{c^{2} x^{2} + 1}\right )\, dx + \int \left (- \frac {4 i a b c^{3} x^{3} \log {\left (i c x + 1 \right )}}{c^{2} x^{2} + 1}\right )\, dx\right )}{4} + \left (- \frac {i b^{2} c d x^{2}}{8} - \frac {b^{2} d x}{4}\right ) \log {\left (i c x + 1 \right )}^{2} + \frac {\left (- i b^{2} c^{2} d x^{2} - 2 b^{2} c d x - 3 i b^{2} d\right ) \log {\left (- i c x + 1 \right )}^{2}}{8 c} + \frac {\left (- 2 a b c^{2} d x^{2} + 4 i a b c d x + i b^{2} c^{2} d x^{2} \log {\left (i c x + 1 \right )} + 2 b^{2} c d x \log {\left (i c x + 1 \right )} + 2 b^{2} c d x - i b^{2} d \log {\left (i c x + 1 \right )}\right ) \log {\left (- i c x + 1 \right )}}{4 c} \]
[In]
[Out]
\[ \int (d+i c d x) (a+b \arctan (c x))^2 \, dx=\int { {\left (i \, c d x + d\right )} {\left (b \arctan \left (c x\right ) + a\right )}^{2} \,d x } \]
[In]
[Out]
\[ \int (d+i c d x) (a+b \arctan (c x))^2 \, dx=\int { {\left (i \, c d x + d\right )} {\left (b \arctan \left (c x\right ) + a\right )}^{2} \,d x } \]
[In]
[Out]
Timed out. \[ \int (d+i c d x) (a+b \arctan (c x))^2 \, dx=\int {\left (a+b\,\mathrm {atan}\left (c\,x\right )\right )}^2\,\left (d+c\,d\,x\,1{}\mathrm {i}\right ) \,d x \]
[In]
[Out]